﻿using CommunityToolkit.Mvvm.ComponentModel;
using System.Windows.Media;

namespace 小玩意.ViewModel
{
    internal class ErrorViewModel : ObservableObject
    {
        private static string _path = @"C:\Users\Think book\Pictures\Saved Pictures\捕获 (2).PNG";
        public string Path { get => _path; set => SetProperty(ref _path, value); }

        private static string _errorText;
        public string ErrorText { get => _errorText; set => SetProperty(ref _errorText, value); }

        private static Brush _colors = new SolidColorBrush(Colors.Red);
        public Brush Color { get => _colors; set => SetProperty(ref _colors, value); }



        public ErrorViewModel()
        {

        }

        public static void Errornotice(string str, bool b)
        {
            if (!b)
            {
                //_path = "";
                _errorText = str;
                _colors = new SolidColorBrush(Colors.Green);
            }
            else
            {
                //_path = "";
                _errorText = str;
                _colors = new SolidColorBrush(Colors.Red);
            }
            ErrorBox errorBox = new ErrorBox();
            errorBox.Show();
        }



    }
}
